tree.ui.Overlay = Class({
     extend: tree.ui.Container,
    
    init: function(text)
	{
		tree.ui.Container.apply(this);
		this.connect('added', this.added);
		
	},
	
	center: function()
	{
	    var width = window.innerWidth / 2;
		var height = window.innerHeight / 2;
		
		this.set_style('left', width);
		this.set_style('top', height);
		this.set_style('z-index', 999);
		this.set_style('position', 'absolute');
		
	},
	
	added: function(evt)
	{
		var widget = evt.widget;
		if(this.exposed)
		{
			var tr = document.createElement('tr');
			var td = document.createElement('td');
			this.htmlelem.appendChild(tr);
			tr.appendChild(td);
			var widget = this.children[i].show();
			td.appendChild(widget);
		}
	},
	
	show: function()
	{
		tree.ui.Container.show.apply(this);
		for(var i=0; i<this.children.length; i++)
		{
			var widget = this.children[i].show();
			this.htmlelem.appendChild(widget);
		}
		return this.htmlelem;
	},

});

